package com.wc.codeforces.总结题.Trip_to_the_Olympiad;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2025/1/4 22:59
 * @description
 * https://codeforces.com/contest/2057/problem/C
 */
public class Main {
    /**
     * 思路：
     * 异或需要 0 1或者 1 0是最大的, 那么取的话只能取 0 1 1, 或者是 1 0 0
     * 10000000  0111111 0111110
     * 找到最大的 2 ^ k
     * 然后 剩下的一个让 2^k - 1, 最后一个数只好和他们不一样就好
     *
     */
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int l, r;

    public static void main(String[] args) {
        int T = sc.nextInt();
        while (T-- > 0) {
            l = sc.nextInt();
            r = sc.nextInt();
            int k = 0;
            for (int i = 29; i >= 0; i--) {
                if (((l ^ r) >> i)== 1) {
                    k = i;
                    break;
                }
            }
            int x = l | ((1 << k) - 1), y = x + 1, z = x == l ? r : l;
            out.println(x + " " + y + " " + z);
        }
        out.flush();
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}

